<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head th:replace="layout/header :: header(title=学生管理)">
<body class="gray-bg">
	
	<div id="infos">
		<div v-show="showList" class="row wrapper wrapper-content animated fadeInRight">
			<div class="col-sm-12">
				<div class="ibox">
					<div class="ibox-title">
						<h5>学生管理</h5>
					</div>
					<div class="ibox-content">
							<div class=" col-sm-2" sec:authorize="hasAuthority('org_student_list')">
								<input type="text" class="form-control" id="userName" @keyup.enter="query" placeholder="学生学号">
							</div>							
							<a sec:authorize="hasAuthority('org_student_list')" id="query" class="btn btn-info" @click="query"><i class="fa fa-search"></i>&nbsp;&nbsp;查询</a>&nbsp;&nbsp;
							<a sec:authorize="hasAuthority('org_student_save')" id= "add" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;&nbsp;新增</a>&nbsp;&nbsp;
							<a sec:authorize="hasAuthority('org_student_update')" class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;&nbsp;修改</a>&nbsp;&nbsp;
							<a sec:authorize="hasAuthority('org_student_delete')" class="btn btn-danger" @click="del"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;删除</a>
						<br>
						<br>
						<div class="row row-lg">
							<div class="col-sm-12">
								<div class="table-responsive">
									<table id="infoList" ></table>			
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>			
		</div>
		
		<div v-show="!showList"
			class="row wrapper wrapper-content animated fadeInRight">
			<div class="col-sm-6 col-sm-offset-3">
				<div class="ibox">
					<div class="ibox-title">
						<h5>{{title}}</h5>
					</div>
					<div class="ibox-content">
						<form class="form-horizontal">
							<div class="form-group">
								<div class="col-sm-2 control-label">学号</div>
								<div class="col-sm-10">
									<input type="text" class="form-control" v-model="info.userName" placeholder="学号" />
								</div>
							</div>
							
							<div class="form-group">
								<div class="col-sm-2 control-label">所属部门</div>
							   	<div class="col-sm-10">
							   		<input type="text" class="form-control" style="cursor:pointer;" v-model="info.department.deptName" @click="deptInfoTree" readonly="readonly" placeholder="所属部门"/>
							    </div>
							</div>
							
							<div class="form-group">
								<div class="col-sm-2 control-label">所属班级</div>
							   	<div class="col-sm-10">
							   		<input type="text" class="form-control" style="cursor:pointer;" v-model="info.clazz.clazzName" @click="clazzInfoTree" readonly="readonly" placeholder="所属班级"/>
							    </div>
							</div>
							
							<div class="form-group">
								<div class="col-sm-2 control-label">姓名</div>
								<div class="col-sm-10">
									<input type="text" class="form-control" v-model="info.nickName" placeholder="姓名" />
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-2 control-label">昵称</div>
								<div class="col-sm-10">
									<input type="text" class="form-control" v-model="info.nickName" placeholder="昵称" />
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-2 control-label">性别</div>
								<div class="col-sm-10">
									<select v-model="info.sex" class="form-control">
										<option value="0">女</option>
										<option value="1">男</option>
									</select>
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-2 control-label">出生日期</div>
								<div class="col-sm-10 layui-input-inline">
									<input id="birthday" type="text" v-model="info.birthday" class="form-control" @click="selectDate" placeholder="出生日期">
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-2 control-label">手机号</div>
								<div class="col-sm-10">
									<input type="text" class="form-control" v-model="info.telephone" placeholder="手机号" />
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-2 control-label">邮箱</div>
								<div class="col-sm-10">
									<input type="text" class="form-control" v-model="info.email" placeholder="邮箱" />
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-2 control-label">住址</div>
								<div class="col-sm-10">
									<input type="text" class="form-control" v-model="info.address" placeholder="住址" />
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-2 control-label">启用状态</div>
								<div class="col-sm-10">
									<label class="radio-inline"><input type="radio"	name="status" value="0" v-model="info.locked" />正常</label>
									<label class="radio-inline"><input type="radio" name="status" value="1" v-model="info.locked" />禁用</label>
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-2 control-label">备注</div>
								<div class="col-sm-10">
									<input type="text" class="form-control" v-model="info.description" placeholder="备注" />
								</div>
							</div>

							<div class="form-group">
								<div class="col-sm-2 control-label"></div>
								<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" /> &nbsp;&nbsp;
								<input type="button" class="btn btn-warning" @click="reload" value="返回" />
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	
		
		
		<!-- 部门树 -->
		<div id="deptLayer" style="display: none; padding: 10px;">
			<ul id="deptTree" class="ztree"></ul>
		</div>
		
		<!-- 班级列表树 -->
		<div id="clazzLayer" style="display: none; padding: 10px;">
			<ul id="clazzTree" class="ztree"></ul>
		</div>

		<script th:src="@{/js/organization/student.js}"></script>
	</div>
		
</body>
</html>